<template>
  <div>
    <type-nav></type-nav>
    <list-container></list-container>
    <recommend></recommend>
    <rank></rank>
    <like></like>
    <floor v-for="floor in floorList" :key="floor.id" :floor="floor">
    </floor>
    <brand></brand>
  </div>
</template>

<script>
import ListContainer from '@/pages/Home/ListContainer'
import Recommend from "@/pages/Home/Recommend";
import Rank from "@/pages/Home/Rank";
import Like from "@/pages/Home/Like";
import Floor from "@/pages/Home/Floor";
import Brand from "@/pages/Home/Brand";
import {mapState} from "vuex";


export default {
  // eslint-disable-next-line vue/multi-word-component-names
  name: "Home",
  components: {
    Brand,
    Floor,
    Like,
    Rank,
    Recommend,
    ListContainer
  },
  mounted() {
    this.getFloorList() //不要给生命周期函数加上async
  },
  methods: {
    async getFloorList() {
      await this.$store.dispatch('home/getFloorList')
    }
  },
  computed: {
    ...mapState('home', ['floorList'])
  },
}
</script>

<style scoped>

</style>